home *** CD-ROM | disk | FTP | other *** search
/ Ham Radio 2000 #1 / Ham Radio 2000.iso / ham2000 / hf / dsp / source / sim.asm < prev    next >
Encoding:
Assembly Source File  |  1991-06-28  |  806 b   |  43 lines

  1.     page    132,63,1,1
  2.     opt    rc
  3.  
  4.     org    p:
  5.  
  6. ; first order high-pass section
  7. ; input in x0, output in a
  8. hpass    macro    frq,store
  9.     move            #(1.0+(1.0/@cos(6.28319*frq)*(1.0-@sin(6.28319*frq))))/2.0,x1
  10.     mpy    x0,x1,a     store,x0
  11.     move            #-1.0/@cos(6.28319*frq)*(1.0-@sin(6.28319*frq)),x1
  12.     macr    -x0,x1,a
  13.     sub    x0,a        a,store
  14.     endm
  15.  
  16.  
  17. ; first order high-pass section
  18. ; input in x0, output in a
  19. hpass2    macro    frq,store
  20.     tfr    x0,a        x:<store\1,x1
  21.     sub    x1,a        x0,x:<store\1
  22.     move            x:<store\2,x0
  23.     move            #-1.0/@cos(6.28319*frq)*(1.0-@sin(6.28319*frq)),x1
  24.     macr    -x0,x1,a
  25.     move            a,x:<store\2
  26.     endm
  27.  
  28.     clr    a
  29.     move            a,x:<rdc
  30.  
  31. loop    move    y:$ffe0,x0
  32.     hpass2    20.0/9600.0,del
  33.     move    a,y:$ffe0
  34.     jmp    <loop
  35.  
  36.     org    x:
  37.  
  38. rdc    ds    1                    ; running DC-level
  39. del1    ds    1
  40. del2    ds    1
  41.  
  42.     end
  43.